package com.lyb.mapper;

import com.lyb.pojo.Borrow;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BorrowMapper {
    @Insert("insert into borrow values (#{borrow.lend},#{borrow.bookId},#{borrow.createTime},#{borrow.updateTime},#{borrow.returnStatus},#{borrow.userId})")
    Boolean add(@Param("borrow") Borrow borrow);
//    @Select("select * from borrow")
    List<Borrow> queryPage();
    @Delete("delete from borrow where id=#{id}")
    Boolean del(Long id);
    @Update("update borrow set lend=#{borrow.lend},bookId=#{borrow.bookId},updateTime=#{borrow.updateTime},returnStatus=#{borrow.returnStatus}")
    Boolean update(@Param("borrow") Borrow borrow);
}
